package com.bsfcs.rag.repository;

import com.bsfcs.rag.entity.ContractPaymoney;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContractpaymoneyRepository extends JpaRepository<ContractPaymoney, String> {
    

    
    /**
     * 根据多个合同ID查询付款记录
     */
    @Query("SELECT p FROM ContractPaymoney p WHERE p.contr_id_new IN :contractIds ORDER BY p.contr_id_new, p.pay_time DESC")
    List<ContractPaymoney> findByContractIds(@Param("contractIds") List<String> contractIds);
    

}